<template>
	<view class="">
		<uni-card :border='false' padding='0' spacing='0' margin='10'>
			<div style="display: flex; justify-content: space-between; padding: 0 10px;">
				<div>
					<img :src="myInfo.headImageSrc !== '' ? imgBaseUrl + myInfo.headImageSrc : defaultAvatarImg"
						alt="头像" style="width: 110px; height: 110px;">
				</div>
				<div style="text-align: left; margin-left: 10px; flex: 5; padding-top: 10px;">
					<div><span style="font-weight: bolder;">昵称：{{myInfo.nickname}}</span></div>
					<div><span style="font-size: 10px;">帐号：{{myInfo.phoneNumber}}</span></div>
					<div><span style="font-size: 10px;">所在高校：{{myInfo.university}}</span></div>
					<div><span style="font-size: 10px;">用户类型：{{myInfo.userType === '0' ? '普通用户' : '管理员'}}</span>
					</div>
				</div>
			</div>
		</uni-card>



	</view>
</template>

<script>
	import baseUrl from '../publicData/baseUrl.js'

	export default {
		name: "myInfo",

		data() {
			return {
				myInfo: {
					QQMail: "2974099467@qq.com",
					birthday: null,
					college: null,
					enrollmentTime: null,
					headImageSrc: "",
					id: 3,
					nickname: "AixXu",
					phoneNumber: "17707061724",
					sex: "男",
					university: "天津中德应用技术大学",
					userType: "1",
				},
				imgBaseUrl: baseUrl.imgBaseUrl,

				// 未上传头像的默认头像图片地址
				defaultAvatarImg: '',
			}
		},

		onLoad(option) {
			console.log(JSON.parse(option.myInfo))

			// 当用户为上传头像，为其设置默认头像
			if (this.myInfo.headImageSrc === '') {
				this.myInfo.sex === '男' ? this.defaultAvatarImg = '../static/defaultAvatarImg/nansheng.png' : this
					.defaultAvatarImg = '../static/defaultAvatarImg/nvsheng.png'
			} else {

			}
		},

		methods: {
			
		}

	}
</script>

<style scoped>

</style>